package edu.uoc.tds.pec4.vista;

import edu.uoc.tds.pec4.gestor.GestorInformes;
import edu.uoc.tds.pec4.model.SS1_CentroDocente;
import edu.uoc.tds.pec4.model.SS1_TipoEvento;
import edu.uoc.tds.pec4.model.SS1_Universidad;
import edu.uoc.tds.pec4.model.SS3_InformeEventosAsistente;
import edu.uoc.tds.pec4.util.ComponentsUtils;
import edu.uoc.tds.pec4.util.ExceptionUtils;
import edu.uoc.tds.pec4.util.LanguageUtils;
import edu.uoc.tds.pec4.excepciones.PrecioIncongruenteException;
import java.rmi.RemoteException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;

/**
 * Tecnicas de Desarrollo de Software - (UOC)
 * Clase que modela la pantalla de Informe de Ingresos Totales
 * @author José Carlos Fernández Luque
 * @version 1.0
 */
public class SS3_PantallaIngresosTotales extends javax.swing.JPanel {

    /**
     *
     */
    public GestorInformes objetoRemoto;
    /**
     *
     */
    public float sumaImport;
    private boolean isInitialCharge = false;

    /**
     *
     * @param objetoRemoto
     */
    public SS3_PantallaIngresosTotales(GestorInformes objetoRemoto) {
        this.objetoRemoto = objetoRemoto;
        initComponents();
        formatLanguage();
        intialCharge();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        resultPanel = new javax.swing.JPanel();
        totalLabel = new javax.swing.JLabel();
        ingresosTotalesLabel = new javax.swing.JLabel();
        resultScroll = new javax.swing.JScrollPane();
        resultTable = new javax.swing.JTable();
        searchPanel = new javax.swing.JPanel();
        incomeLowerField = new javax.swing.JTextField();
        cleanButton = new javax.swing.JButton();
        incomeGreaterField = new javax.swing.JTextField();
        incomeGreaterLabel = new javax.swing.JLabel();
        incomeLowerLabel = new javax.swing.JLabel();
        searchButton = new javax.swing.JButton();
        centerLabel = new javax.swing.JLabel();
        eventTypeCombo = new javax.swing.JComboBox();
        eventTypeLabel = new javax.swing.JLabel();
        universityLabel = new javax.swing.JLabel();
        centerCombo = new javax.swing.JComboBox();
        universityCombo = new javax.swing.JComboBox();
        tittleLabel = new javax.swing.JLabel();

        resultPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Resultado de la búsqueda"));

        totalLabel.setText("333");

        ingresosTotalesLabel.setText("Los ingresos totales de la busqueda son: ");

        resultTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Universidad", "Centro", "Tipo Evento", "Evento", "Precio"
            }
        ));
        resultScroll.setViewportView(resultTable);

        javax.swing.GroupLayout resultPanelLayout = new javax.swing.GroupLayout(resultPanel);
        resultPanel.setLayout(resultPanelLayout);
        resultPanelLayout.setHorizontalGroup(
            resultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(resultPanelLayout.createSequentialGroup()
                .addGroup(resultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(resultPanelLayout.createSequentialGroup()
                        .addGap(159, 159, 159)
                        .addComponent(ingresosTotalesLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(totalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(resultPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(resultScroll, javax.swing.GroupLayout.PREFERRED_SIZE, 610, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(12, Short.MAX_VALUE))
        );
        resultPanelLayout.setVerticalGroup(
            resultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, resultPanelLayout.createSequentialGroup()
                .addComponent(resultScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(resultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ingresosTotalesLabel)
                    .addComponent(totalLabel))
                .addContainerGap())
        );

        searchPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Criterios de búsqueda"));

        cleanButton.setText("Limpiar");
        cleanButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cleanButtonActionPerformed(evt);
            }
        });

        incomeGreaterLabel.setText("Precio mayor de:");

        incomeLowerLabel.setText("Percio menor de:");

        searchButton.setText("Buscar");
        searchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchButtonActionPerformed(evt);
            }
        });

        centerLabel.setText("Centro");

        eventTypeCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        eventTypeLabel.setText("Tipo Evento");

        universityLabel.setText("Universidad");

        centerCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        universityCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        universityCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                universityComboActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout searchPanelLayout = new javax.swing.GroupLayout(searchPanel);
        searchPanel.setLayout(searchPanelLayout);
        searchPanelLayout.setHorizontalGroup(
            searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(searchPanelLayout.createSequentialGroup()
                .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(universityLabel)
                    .addComponent(centerLabel)
                    .addComponent(eventTypeLabel))
                .addGap(43, 43, 43)
                .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(centerCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(eventTypeCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(universityCombo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cleanButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(incomeLowerLabel)
                    .addComponent(incomeGreaterLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(incomeLowerField, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                        .addComponent(incomeGreaterField))
                    .addComponent(searchButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(33, Short.MAX_VALUE))
        );
        searchPanelLayout.setVerticalGroup(
            searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(searchPanelLayout.createSequentialGroup()
                .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(universityLabel)
                    .addComponent(incomeGreaterLabel)
                    .addComponent(incomeGreaterField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(universityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(searchPanelLayout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(centerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(incomeLowerLabel)
                                .addComponent(centerCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(eventTypeLabel)
                            .addComponent(eventTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(searchPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(incomeLowerField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(19, 19, 19)
                .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cleanButton)
                    .addComponent(searchButton)))
        );

        tittleLabel.setFont(new java.awt.Font("Tahoma", 1, 14));
        tittleLabel.setText("Informe de Ingresos Totales");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(219, 219, 219)
                .addComponent(tittleLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(searchPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(resultPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addComponent(tittleLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(searchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(resultPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed
        cercaResult();
    }//GEN-LAST:event_searchButtonActionPerformed

    private void cleanButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cleanButtonActionPerformed
        universityCombo.setSelectedIndex(0);
        centerCombo.setSelectedIndex(0);
        eventTypeCombo.setSelectedIndex(0);
        incomeGreaterField.setText("");
        incomeLowerField.setText("");
    }//GEN-LAST:event_cleanButtonActionPerformed

    private void universityComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_universityComboActionPerformed
        if (!isInitialCharge) {
            cargaComboCentrosPorUniversidad(centerCombo);
        }
    }//GEN-LAST:event_universityComboActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox centerCombo;
    private javax.swing.JLabel centerLabel;
    private javax.swing.JButton cleanButton;
    private javax.swing.JComboBox eventTypeCombo;
    private javax.swing.JLabel eventTypeLabel;
    private javax.swing.JTextField incomeGreaterField;
    private javax.swing.JLabel incomeGreaterLabel;
    private javax.swing.JTextField incomeLowerField;
    private javax.swing.JLabel incomeLowerLabel;
    private javax.swing.JLabel ingresosTotalesLabel;
    private javax.swing.JPanel resultPanel;
    private javax.swing.JScrollPane resultScroll;
    private javax.swing.JTable resultTable;
    private javax.swing.JButton searchButton;
    private javax.swing.JPanel searchPanel;
    private javax.swing.JLabel tittleLabel;
    private javax.swing.JLabel totalLabel;
    private javax.swing.JComboBox universityCombo;
    private javax.swing.JLabel universityLabel;
    // End of variables declaration//GEN-END:variables

    private void formatLanguage() {
        eventTypeLabel.setText(LanguageUtils.getMessage("SS3.evento"));
        centerLabel.setText(LanguageUtils.getMessage("SS3.centro"));
        universityLabel.setText(LanguageUtils.getMessage("SS3.universidad"));
        searchButton.setText(LanguageUtils.getMessage("SS3.buscar"));
        cleanButton.setText(LanguageUtils.getMessage("SS3.limpiar"));
        tittleLabel.setText(LanguageUtils.getMessage("SS3.InformeIngresosTotales"));
        incomeGreaterLabel.setText(LanguageUtils.getMessage("SS3.precioMayor"));
        incomeLowerLabel.setText(LanguageUtils.getMessage("SS3.precioMenor"));
        searchPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(LanguageUtils.getMessage("SS3.criterioBusqueda")));
        resultPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(LanguageUtils.getMessage("SS3.resultadoBusqueda")));
    }

    private void intialCharge() {
        isInitialCharge = true;
        cargaCombo(universityCombo, "universidades");
        cargaCombo(centerCombo, "centros");
        cargaCombo(eventTypeCombo, "tipoEventos");
        List listCostByEvent = new ArrayList();
        resultTable = carregaResutTable(resultTable, listCostByEvent);
        isInitialCharge = false;
    }

    private void cargaComboCentrosPorUniversidad(JComboBox centerComb) {
        try {
            List lista = new ArrayList();
            lista = objetoRemoto.dameCentrosUniversidad((SS1_Universidad) universityCombo.getSelectedItem());
            SS1_CentroDocente nullElement = new SS1_CentroDocente();
            nullElement.setId(-1);
            lista.add(0, nullElement);
            ComponentsUtils.cargaCombo(centerComb, lista);
        } catch (RemoteException ex) {
            ExceptionUtils.visualizarError(LanguageUtils.getMessage("ERR_Remote"));
            Logger.getLogger(SS3_PantallaIngresosTotales.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            ExceptionUtils.visualizarError(ExceptionUtils.ERR_Inesperado);
            Logger.getLogger(SS3_PantallaIngresosTotales.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void cargaCombo(JComboBox combo, String string) {
        List lista = new ArrayList();
        try {
            if (string.equalsIgnoreCase("universidades")) {
                lista = objetoRemoto.getComboUniversidades();
                SS1_Universidad nullElement = new SS1_Universidad();
                nullElement.setId(-1);
                lista.add(0, nullElement);
            } else if (string.equalsIgnoreCase("centros")) {
                lista = objetoRemoto.getComboCentroDocente();
                SS1_CentroDocente nullElement = new SS1_CentroDocente();
                nullElement.setId(-1);
                lista.add(0, nullElement);
            } else if (string.equalsIgnoreCase("tipoEventos")) {
                lista = objetoRemoto.getComboTipoEvento();
                SS1_TipoEvento nullElement = new SS1_TipoEvento();
                nullElement.setId(-1);
                lista.add(0, nullElement);
            }
        } catch (Exception ex) {
            ExceptionUtils.visualizarError(ExceptionUtils.ERR_Inesperado);
            Logger.getLogger(SS3_PantallaIngresosTotales.class.getName()).log(Level.SEVERE, null, ex);
        }
        ComponentsUtils.cargaCombo(combo, lista);
    }

    private JTable carregaResutTable(JTable table, List list) {
        table.removeAll();
        ModelResult model = new ModelResult(list);
        table.setModel(model);
        return table;
    }

    private void cercaResult() {
        List<SS3_InformeEventosAsistente> list = null;
        try {
            if (!incomeGreaterField.getText().equalsIgnoreCase("")
                    && !incomeLowerField.getText().equalsIgnoreCase("")
                    && Integer.parseInt(incomeGreaterField.getText()) > Integer.parseInt(incomeLowerField.getText())) {
                throw new PrecioIncongruenteException();
            }
            list = (ArrayList<SS3_InformeEventosAsistente>) objetoRemoto.dameResultIngresosTotales(
                    (SS1_Universidad) universityCombo.getSelectedItem(),
                    (SS1_CentroDocente) centerCombo.getSelectedItem(),
                    (SS1_TipoEvento) eventTypeCombo.getSelectedItem(),
                    incomeGreaterField.getText(), incomeLowerField.getText());
            sumaImport = 0;
            for (int i = 0; i < list.size(); i++) {
                sumaImport = sumaImport + list.get(i).getPrecio();
            }
            totalLabel.setText(sumaImport + "");
        } catch (PrecioIncongruenteException ex) {
            ExceptionUtils.visualizarInformacion(LanguageUtils.getMessage("SS3.error.formato.precio.incongruentes"));
            Logger.getLogger(SS3_PantallaEventosAsistente.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ParseException ex) {
            ExceptionUtils.visualizarInformacion(LanguageUtils.getMessage("SS3.error.formato.fecha.incorrecta"));
            Logger.getLogger(SS3_PantallaIngresosTotales.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RemoteException ex) {
            ExceptionUtils.visualizarError(LanguageUtils.getMessage("ERR_Remote"));
            Logger.getLogger(SS3_PantallaIngresosTotales.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalArgumentException ex) {
            ExceptionUtils.visualizarInformacion(LanguageUtils.getMessage("SS3.error.formato.incorrecto"));
            Logger.getLogger(SS3_PantallaIngresosTotales.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            ExceptionUtils.visualizarError(ExceptionUtils.ERR_Inesperado);
            Logger.getLogger(SS3_PantallaIngresosTotales.class.getName()).log(Level.SEVERE, null, ex);
        }
        resultTable = carregaResutTable(resultTable, list);
    }

    class ModelResult extends AbstractTableModel {

        private static final long serialVersionUID = 1L;
        protected Vector<String> cabecera = new Vector<String>();
        protected Vector<Vector> eventosAsistente = new Vector<Vector>();

        public ModelResult(List<SS3_InformeEventosAsistente> lissS3_InformeEventosAsistente) {
            setCapcelera();
            setResulTabla(lissS3_InformeEventosAsistente);
        }

        private void setCapcelera() {
            cabecera.add(LanguageUtils.getMessage("SS3.universidad"));
            cabecera.add(LanguageUtils.getMessage("SS3.centro"));
            cabecera.add(LanguageUtils.getMessage("SS3.tipoEvento"));
            cabecera.add(LanguageUtils.getMessage("SS3.evento"));
            cabecera.add(LanguageUtils.getMessage("SS3.precio"));
        }

        private void setResulTabla(List<SS3_InformeEventosAsistente> listSS3_InformeEventosAsistente) {
            Vector<String> universityColumn = new Vector<String>();
            Vector<String> centerColumn = new Vector<String>();
            Vector<String> eventTypeColumn = new Vector<String>();
            Vector<String> eventColumn = new Vector<String>();
            Vector<String> priceColumn = new Vector<String>();
            ;

            for (Iterator<SS3_InformeEventosAsistente> it = listSS3_InformeEventosAsistente.iterator(); it.hasNext();) {
                SS3_InformeEventosAsistente sS3_InformeEventosAsistente = it.next();
                universityColumn.add(sS3_InformeEventosAsistente.getUniversidad());
                centerColumn.add(sS3_InformeEventosAsistente.getCentro());
                eventTypeColumn.add(sS3_InformeEventosAsistente.getTipoEvento());
                eventColumn.add(sS3_InformeEventosAsistente.getEvento());
                priceColumn.add(sS3_InformeEventosAsistente.getPrecio() + "");
            }
            eventosAsistente.add(universityColumn);
            eventosAsistente.add(centerColumn);
            eventosAsistente.add(eventTypeColumn);
            eventosAsistente.add(eventColumn);
            eventosAsistente.add(priceColumn);
        }

        public int getRowCount() {
            return (((Vector) eventosAsistente.get(0)).size());
        }

        public int getColumnCount() {
            return (eventosAsistente.size());
        }

        @Override
        public String getColumnName(int col) {
            return ((String) cabecera.get(col));
        }

        public boolean getScrollableTrackViewportHeight() {
            return (true);
        }

        public boolean getScrollableTrackViewportWidth() {
            return (true);
        }

        public Object getValueAt(int fila, int col) {
            return (((Vector) eventosAsistente.get(col)).get(fila));
        }

        @Override
        public boolean isCellEditable(int fila, int columna) {
            return (false);
        }
    }
}
